<template>
	<view style="display: flex;flex-direction: column;align-items: center;" >
		<!-- <view class="top" :style="{ 'background-image': 'url(' + bg + ')' }"> -->
		<view class="top">
		<!-- <uni-nav-bar title="导航栏组件"></uni-nav-bar> -->
			<view class="left">
				<image class="img" :src="obj.userImg" mode="aspectFill"></image>
				
				<view class="right_a" >
					<text>{{obj.name}}</text>
					<view class="span" >
						<text>职称认证({{listApp.length}})</text>
						<!-- <uni-icons type="right" color="#fff" size="10"></uni-icons> -->
					</view>
				</view>
			</view>
			<!-- <view class="right">
				<view class="size">
					技师评分
				</view>
				<view class="assess">
					<text style="font-size: 38rpx;">{{obj.appraise.slice(0,1)}}</text>
					<text>{{obj.appraise.slice(1,4)}}</text>
				</view>
				<uni-rate allow-half size="10" activeColor="#FF4646" :readonly="true" :value="obj.appraise" />
			</view> -->
		</view>
		
		
		<!-- swiper -->
		<view class="switch">
			<view class="title">
				<text :class="{bor_bo:currenta==0}" @tap="changeCurrent(0)" >职称认证({{listApp.length}})</text>
				<text :class="{bor_bo:currenta==1}"  @tap="changeCurrent(1)">技能勋章</text>
			</view>
			
			<swiper :current="currenta" @change ="changeCurr" >
				<!-- 评价 -->
				<swiper-item>
					<view class="swiper-item center" >
						<view class="noList" v-if="listApp.length == 0" >
							<image class="imag" src="@/static/images/test/noList@4x.png" mode="aspectFit"></image>
							<text>技师还在努力</text>
						</view>
						<view v-else class="imaga">
							<view class="card_a" v-for="(item,i) in listApp" :key="item.id">
								<image :src="item.Image" mode="aspectFit"></image>
							</view>
						</view>
					</view>
				</swiper-item>
				<swiper-item>
					<view class="swiper-item center" >
						<view class="noList" v-if="list.length == 0" >
							<image class="imag" src="@/static/images/test/noList@4x.png" mode="aspectFit"></image>
							<text>技师还在努力</text>
						</view>
						<view v-else class="imaga">
							<view class="card_a" v-for="(item,i) in list" :key="item.id">
								<image :src="item.Image" mode="aspectFit"></image>
							</view>
						</view>
					</view>
				</swiper-item>
			</swiper>
			
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// bg: '../../../static/images/test/bg@4x.png',
				// 模拟数据
				obj: {
					name:"张大茂",
					userImg: "../../../static/images/face/auth-face.png",
					add:2000,
					shop:"萌宠之家洗护中心",
					appraise: "5.00",
					
				},
				// 职称认证
				listApp:[
					{
						id:1,
						Image:"../../../static/images/face/auth-face.png"
					},
					{
						id:2,
						Image:"../../../static/images/face/auth-face.png"
					},
					{
						id:3,
						Image:"../../../static/images/face/auth-face.png"
					}
				],
				// 技能勋章
				list:[],
				
				
				userjiId:0,
				currenta:0
			};
		},
		onLoad(options) {
			this.userjiId = options.id
		},
		methods:{
			changeCurrent(num){
				this.currenta = num
			},
			changeCurr(e){
				this.currenta = e.detail.current
				// console.log(e)
			},
			toAuth(userjiId){
				uni.navigateTo({
					url:`/pages/service/technician/auth?userId=${userjiId}`
				})
			}
		},
		
		
		
	}
</script>

<style lang="scss">
	.imaga{
		display: flex;
		// justify-content: space-evenly;
		flex-wrap: wrap;
		.card_a{
			margin: 0rpx  26rpx;
			image{
				width: 260rpx;
				height: 354rpx;
			}
		}
	}

	.top {
		background-size: cover;
		border-radius: 0 0 10% 10%;
		width: 100%;
		height: 400rpx;
		position: relative;
		.left{
			position: absolute;
			bottom: 108rpx;
			left: 64rpx;
			display: flex;
			.right_a{
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				margin-left: 34rpx;
				text{
			
					font-size: 30rpx;
				
			
					color: #000000;
				}
				.span{
					display: flex;
					align-items: center;
					border-radius: 2rpx;
					opacity: 1;
					text-align: center;
					padding: 2rpx;
					/* 字体标准黑色 */
					background: #3D3D3D;
					text{
						font-size: 18rpx;
						color: #FFFFFF;
						display: block;
						
					}
				}
			}
		}
		
		.right{
			position: absolute;
			right: 72rpx;
				bottom: 108rpx;
				.size{
					font-size: 24rpx;
				}
		}
	}
	.img {
		width: 110rpx;
		height: 110rpx;
		border-radius: 50%;
		
	}
	uni-swiper {
		height: 900rpx;
		max-height: 900rpx;
		overflow-y: auto;
	}
	.imag{

		width: 350rpx;
		height: 224rpx;
		margin-top: 100rpx;
	
	}
	.center{
		display: flex;
		align-items: center;
		justify-content: center;
		.noList{
			display: flex;
			flex-direction: column;
			
			align-items: center;
		}
	}
	.card{
		font-size: 26rpx;
		padding: 24rpx;
		border-radius: 16rpx;
		width: 674rpx;
		position: absolute;
		top: 320rpx;
		background: #FFFFFF;
	
		box-shadow: 0px 0px 8rpx 0px rgba(0, 0, 0, 0.05);
		.al_center{
			display: flex;
			align-items: center;
		}
		.mg{
			margin:4rpx 10rpx;
		}
	}

	.switch{
		width: 670rpx;
		position: absolute;
		top: 300rpx;
		box-shadow: 0 0 4rpx 0 #aaa;
		z-index: 999;
		background-color: #FFFFFF;
		border-radius: 16rpx;
		.title{
			width: 100%;
			display: flex;
			justify-content: space-around;
			padding: 10rpx 0;
			text{
				display: block;
				padding-bottom: 10rpx;
			}
		}
		.bor_bo{
			border-bottom: 4rpx solid #6BF9C5 ;
		}
	}
</style>